package com.bckj.fastboot.security.service;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

@Slf4j
@RequiredArgsConstructor
public class FastSysUserDetailsServiceImpl implements FastUserDetailsService {

    private final FastUserDetailsProvider oauthDetailsProvider;

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return getUserDetails(oauthDetailsProvider.getSysUserDetails(username));
    }

    @Override
    public int getOrder() {
        return Integer.MIN_VALUE;
    }
}
